package day01;

/**
 * @author Jetwang
 * @version 1.0
 * @since 2023/2/27 10:31
 */
public class SingleLinkedListSentinelTest {
    public static void main(String[] args) {
        SingleLinkedListSentinel list = new SingleLinkedListSentinel();

        list.addLast(1);
        list.addLast(2);
        list.addLast(3);
        list.addLast(4);
        list.forEach(System.out::println);

        System.out.println("======");
        System.out.println(list.get(1));
        // System.out.println(list.get(4));
        System.out.println("======");
        list.insert(0, 888);
        list.forEach(System.out::println);
        list.addFirst(999);
        System.out.println("======");
        list.forEach(System.out::println);
        list.remove(0);
        System.out.println("======");
        list.forEach(System.out::println);
        // list.remove(5);
        // System.out.println("======");
        // list.forEach(System.out::println);
    }
}
